require 'login_system'
class Plugin::GalleryController < ActionController::Base
  before_filter :set_site_template_root
  def set_site_template_root
    self.class.template_root = "#{RAILS_ROOT}/components/"
    @template.base_path = template_root
  end 
  include LoginSystem
  before_filter :login_required, :only => [:config]
  
  def show
    @plugin=Extplugin.find_by_name("gallery")
	@config=@plugin.config 
    if @config["proxy"]==""
      @proxy=nil
    else
      @proxy=@config["proxy"]
    end
    if @config["port"]==""
      @port=nil
    else
      @port=@config["port"]
    end
    if @plugin.activated==1
  	  render(:layout => false)
  	else
  	  render :text => _("not activated")
  	end
  end
	
  def config
    @plugin=Extplugin.find_by_name("gallery")
    @config=@plugin.config 
  end
  
end